/***************日志**************
* V 1.0.6
* 2021/09/18 yhy 新增附带Headers加载网页loadUrlWithHeaders
* 2021/08/18 yhy 新增获取网络故障检测接口getNetworkCheckReport
* 2021/08/18 yhy 新增网络故障检测接口networkCheck
* 2021/07/15 yhy 新增RFID盘询接口getInventoryInfo
* 2021/05/21 yhy getGpsInfo新增入参locationType 参数
* 2021/05/18 yhy 新增获取状态栏高度getStatusBarHeight
* 2021/05/17 yhy 人脸识别新版新增motions 参数
* 2021/04/13 yhy openUrl新增webTransparent 参数
* 2021/03/05 yhy 新增openSysSetting 跳转到系统设置页（展业pad）
* 2021/02/23 yhy 新增saveSerialNumber 保存序列号（展业pad）
* 2021/02/20 yhy openUrl新增lightAppId、 lightAppUrl参数
* 2021/02/03 yhy 新增statusBar改变导航栏颜色接口
* 2020/10/23 yhy openUrl新增useWKWebView 参数
* 2020/10/13 pzh 新增分享到企业微信接口
* 2020/9/27 pzh 新增获取微信Token接口
* 2020/8/24 pzh 新增云文档选择器，QuitSys增加returnData字段
* 2020/8/20 yhy 新增分组选择创建群聊接口 groupAddressToChat
* 2020/7/21 yhy shareUrlToZH新增参数 sessionId
* 2020/7/7 cf 新增获取页面类型 getWebPageType
* 2020/5/12 yhy 新增设置招乎事件监听setZHEventListener
* 2020/4/27 yhy 扫描身份证新增参数needSave
* 2020/4/15 yhy 新增获取招乎截屏文件 getScreenshot
* 2020/3/25 yhy 新增生成条形码/二维码信息makeCode
* 2020/3/12 yhy 人脸识别新版faceRecognitionV2 新增mode 参数
* 2020/3/12 yhy 新增获取所有文件信息接口 getAllFiles
* 2020/3/6 pzh 新增分享文件接口 shareFile
* 2019/12/27 yhy 新增唤醒地图导航 mapDirection
* 2019/11/8 yhy 录音audioRecord版本1增加参数samplingRate、samplingBits、outfileExt
* 2019/10/31 yhy 新增意见反馈 newFeedback
* 2019/9/18 yhy 新增本地键值对存储 keyValueStorage
* 2019/6/26 yhy 新增记录web前端日志 recordWebLog
* 2019/4/1 yhy 新增获取用户data和token getDataAndTokenmakeCode
* 2019/3/28 yhy 新增进入招乎会话列表 openZHChatList
* 2019/3/13 yhy 新增人脸识别新版 faceRecognitionV2
* 2018/12/20 pzh 新增移事通检查更新 appUpgrade，openUrl 增加 quitPage 参数
* 2018/12/18 pzh 新增营业执照扫描 scanBusinessLicense 和银行卡扫描 scanBankCard
* 2018/11/29 yhy 新增获取当前招乎呼叫状态 fetchCallState
* 2018/8/29 yhy 新增检测移动设备是否安装某app checkAppIsInstalled
* 2018/7/24 yhy 打开url新增参数webWatermark
* 2018/7/18 yhy 新增返回上一页previosPage
* 2018/7/3 yhy 新增蓝牙通信bluetoothCommunication
* 2018/6/27 yhy camera&ystCamera增加recordSystemGPS
* 2018/5/22 yhy 新增发起招乎呼叫callOut, 获取招乎录制文件getRecordFile
* 2018/5/18 yhy 新增名片识别bizCardRecognition
* 2018/5/2 yhy 新增保存联系人到手机通讯录saveContact
* 2018/4/27 lwx 修改window.location方式为iframe方式，防止同时多次调用只拦截一次的问题
* 2018/4/24 yhy 新增改变屏幕方向changeOrientation
* 2018/3/20 yhy 新增控制打印机打印printer
* 2018/3/15 yhy 新增扫描枪扫描docScan
* 2018/3/12 yhy 新增接口手机通讯录选择器phoneSelector
* 2018/3/8 yhy fileSelector增加showDownloadFile
* 2018/3/6 yhy camera&ystCamera增加dateFormat和fontSize参数
* 2018/2/7 tcl camera&ystCamera增加crop参数

* V 1.0.5
* 2017/12/11 tcl 新增addOrRemoveHomeItem/checkHomeItemAdded接口

* V 1.0.4
* 2017/10/31 tcl checkGesturePwd接口增加timeOut属性

* V 1.0.3
* 2017/10/09 tcl 新增URL分享到招乎功能

* V 1.0.2
* 2017/06/13 tcl 新增人脸识别功能

* V 1.0.1
* 2017/04/26 tcl 增加webWaterMark水印API，修改extend方法bug

* V 1.0.0
* 2016/08/10 lwx 改进iframe内回调方法的执行，主要增加全局callbacks参数处理回调方法集合
* 2016/06/10 fkl 使用extend方法，合并默认参数
* 2015/06/01 tcl 包含基本的JSAPI方法，格式统一
*/

var MobileJS = {
    PreviewPolicy: {
        SaveToDevice: Number('0b1'),
        ShareToZH: Number('0b10'),
        ShareToWX: Number('0b100'),
        RecognizeQRCode: Number('0b1000'),
        ShareToWXMoments: Number('0b10000')
    },
    uniqueID: 0,
    callbacks: {},
    callbackInString: function (callback) {
        if (callback == '') { // 为空 直接返回
            return callback
        }
        var that = top.MobileJS;
        if (that == undefined) {
            top.MobileJS = this
            that = top.MobileJS
        }
        var callbackID = 'cb_' + (that.uniqueID++) + '_' + new Date().getTime();
        if (typeof callback === 'function') {
            that.callbacks[callbackID] = callback;
        } else if (typeof callback === 'string') {
            that.callbacks[callbackID] = window[callback];
        }
        return encodeURIComponent('MobileJS.callbacks["' + callbackID + '"]');
    },
    customSchema:function(uri){
        var iframe = document.createElement('IFRAME')
        iframe.setAttribute('src', uri)
        document.body.appendChild(iframe)
        iframe.parentNode.removeChild(iframe)
        iframe = null
    },
    extend: function (a, b) {
        for (var key in a) {
            if (!!b && b.hasOwnProperty(key)) {
                a[key] = b[key];
            };
            if (key === 'callback') {
                a[key] = this.callbackInString(a[key]);
            }
        };
        return a;
    },
    //摄像头调用模式
    //20180627增加recordSystemGPS
    //20170306增加dateFormat、fontSize
    //20161128增加recordUserInfo、recordAddress
    camera: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "photo",   //模式，包括photo和video
            returnType: "0",  //photo参数，返回类型
            maxSize: 500,   //photo参数，照片压缩到的最大大小，单位KB（0表示不限制）
            recordGPS: false,   //photo参数，是否记录GPS信息，需打开GPS权限
            recordSystemGPS: false,   //photo参数，是否记录系统GPS信息，需打开GPS开关
            recordDate: false,   //photo参数，是否记录拍照时间，取服务器时间，需实时联网
            recordUserInfo: false,   //photo参数，是否记录拍照者姓名和id
            recordAddress: false,   //photo参数，是否记录拍照地理位置
            dateFormat: "yyyy-MM-dd",   //photo参数，记录的时间格式
            fontSize: "S",   //photo参数，记录的时间格式
            maxTime: 600,    //video参数，视频录制的最长拍摄时间，单位秒（0表示不限制）
            orientation: "",  //photo参数, 限制照片方向
            crop: false,
            enhanceMode: ""  //photo参数, 图片增强模式
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=camera',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&mode=', cfg.mode,
                    '&returnType=', cfg.returnType,
                    '&maxSize=', cfg.maxSize,
                    '&recordGPS=', cfg.recordGPS,
                    '&recordSystemGPS=', cfg.recordSystemGPS,
                    '&recordDate=', cfg.recordDate,
                    '&recordUserInfo=', cfg.recordUserInfo,
                    '&recordAddress=', cfg.recordAddress,
                    '&dateFormat=', cfg.dateFormat,
                    '&fontSize=', cfg.fontSize,
                    '&maxTime=', cfg.maxTime,
                    '&orientation=', cfg.orientation,
                    '&crop=', cfg.crop,
                    '&enhanceMode=', cfg.enhanceMode].join('');
        MobileJS.customSchema(uri)
    },
    //一事通自定义摄像头，支持品管、连拍、压缩等功能，只支持拍照
    //20180627增加recordSystemGPS
    //20170306增加dateFormat、fontSize
    //20161128增加recordUserInfo、recordAddress
    cameraYst: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "photo",
            returnType: "0",
            text: "提示文字",
            start: 0,
            end: 100,
            maxSize: 500,
            recordGPS: false,   //photo参数，是否记录GPS信息，需打开GPS权限
            recordSystemGPS: false,   //photo参数，是否记录系统GPS信息，需打开GPS开关
            recordDate: false,   //photo参数，是否记录拍照时间，取服务器时间，需实时联网
            recordUserInfo: false,   //photo参数，是否记录拍照者姓名和id
            recordAddress: false,   //photo参数，是否记录拍照地理位置
            dateFormat: "yyyy-MM-dd",   //photo参数，记录的时间格式
            fontSize: "S",   //photo参数，记录的字体大小
            maxTime: 600,    //video参数，视频录制的最长拍摄时间，单位秒（0表示不限制）
            orientation: "",  //photo参数, 限制照片方向
            crop: false,
            enhanceMode: ""  //photo参数, 图片增强模式
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=cameraYst',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&mode=', cfg.mode,
                    '&returnType=', cfg.returnType,
                    '&text=', encodeURIComponent(cfg.text),
                    '&start=', cfg.start,
                    '&end=', cfg.end,
                    '&maxSize=', cfg.maxSize,
                    '&recordGPS=', cfg.recordGPS,
                    '&recordSystemGPS=', cfg.recordSystemGPS,
                    '&recordDate=', cfg.recordDate,
                    '&recordUserInfo=', cfg.recordUserInfo,
                    '&recordAddress=', cfg.recordAddress,
                    '&dateFormat=', cfg.dateFormat,
                    '&fontSize=', cfg.fontSize,
                    '&maxTime=', cfg.maxTime,
                    '&orientation=', cfg.orientation,
                    '&crop=', cfg.crop,
                    '&enhanceMode=', cfg.enhanceMode].join('');
        MobileJS.customSchema(uri);
    },

    //获取文件-20160811增加source：0/1
    queryFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            source: "",
            id: "",
            returnType: "1"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=queryFile',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&id=', encodeURIComponent(cfg.id),
					'&source=', cfg.source,
					'&returnType=', cfg.returnType].join('');
        MobileJS.customSchema(uri);
    },
    //上传文件-20160526
    uploadFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            data: []
        }
        var cfg = this.extend(defaultOption, option);
        var dataStr = JSON.stringify(cfg.data);
        var uri = ['ystMO:///?schema=uploadFile',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
            '&data=', encodeURIComponent(dataStr)].join('');
        MobileJS.customSchema(uri);
    },
    //下载文件-20160301
    downloadFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            fileName: "",    //version=1时的参数
            fileUrl: "",    //version=1时的参数
            fileSize: "",    //version=1时的参数
            fileHash: "",    //version=1时的参数
            data: []    //version=2时的参数
        }
        var cfg = this.extend(defaultOption, option);
        if (cfg.version == "1") {
            var uri = ['ystMO:///?schema=downloadFile',
                        '&version=', cfg.version,
                        '&callback=', cfg.callback,
                        '&asyncData=', encodeURIComponent(cfg.asyncData),
                        '&fileName=', encodeURIComponent(cfg.fileName),
                        '&fileUrl=', encodeURIComponent(cfg.fileUrl),
                        '&fileSize=', cfg.fileSize,
                        '&fileHash=', cfg.fileHash].join('');
            MobileJS.customSchema(uri);
        }
        else if (cfg.version == "2") {
            var dataStr = JSON.stringify(cfg.data);
            var uri = ['ystMO:///?schema=downloadFile',
                        '&version=', cfg.version,
                        '&callback=', cfg.callback,
                        '&asyncData=', encodeURIComponent(cfg.asyncData),
                        '&data=', encodeURIComponent(dataStr)].join('');
            MobileJS.customSchema(uri);
        }
    },
    //删除文件
    deleteFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            //			mode: "photo",
            id: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=deleteFile',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
//					'&mode=', cfg.mode,
					'&id=', cfg.id].join('');
        MobileJS.customSchema(uri);
    },
    //预览文件20160704
    previewFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            id: "",
            data: [],
            curIndex: 0
        }
        var cfg = this.extend(defaultOption, option);
        if (cfg.version == "1") {
            var uri = ['ystMO:///?schema=previewFile',
                        '&version=', cfg.version,
                        '&callback=', cfg.callback,
                        '&asyncData=', encodeURIComponent(cfg.asyncData),
                        '&id=', cfg.id].join('');
            MobileJS.customSchema(uri);
        }
        else if (cfg.version == "2") {
            var dataStr = JSON.stringify(cfg.data);
            var uri = ['ystMO:///?schema=previewFile',
                        '&version=', cfg.version,
                        '&callback=', cfg.callback,
                        '&asyncData=', encodeURIComponent(cfg.asyncData),
                        '&curIndex=', cfg.curIndex,
                        '&data=', encodeURIComponent(dataStr)].join('');
            MobileJS.customSchema(uri);
        }
    },
    //20180308增加showDownloadFile
    //文件选择器
    fileSelector: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            type: "",   //photo/video/audio/document/other，默认为空，即列出所有文件，按时间倒序
            maxCount: 1,
            showDownloadFile: true
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=fileSelector',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&type=', cfg.type,
					'&maxCount=', cfg.maxCount,
                    '&showDownloadFile=', cfg.showDownloadFile].join('');
        MobileJS.customSchema(uri);
    },
    // 获取微信卡券中的发票
    getInvoiceCard: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getInvoiceCard',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    //获取所有文件信息 20200311
    getAllFiles: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getAllFiles',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),].join('');
        MobileJS.customSchema(uri);
    },
    //获取GPS信息
    getGpsInfo: function (option) {
        var defaultOption = {
            version: "1",
            type: "0",
            locationType: "0",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getGpsInfo',
					'&version=', cfg.version,
					'&type=', cfg.type,
                    '&locationType=', cfg.locationType,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //获取位置信息
    getLocationInfo: function (option) {
        var defaultOption = {
            version: "1",
            level: "18",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getLocationInfo',
					'&version=', cfg.version,
                    '&level=', cfg.level,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //20191227增加mapDirection
    //唤醒导航信息
    mapDirection: function (option) {
        var defaultOption = {
            version: "1",
            slon: "",
            slat: "",
            sname: "",
            dlon: "",
            dlat: "",
            dname: "",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=mapDirection',
					'&version=', cfg.version,
                    '&slon=', cfg.slon,
                    '&slat=', cfg.slat,
                    '&sname=', encodeURIComponent(cfg.sname),
                    '&dlon=', cfg.dlon,
                    '&dlat=', cfg.dlat,
                    '&dname=', encodeURIComponent(cfg.dname),
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    // 2019/4/1 yhy
    //获取用户data和token
    getDataAndToken: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            appId: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getDataAndToken',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&appId=', encodeURIComponent(cfg.appId),
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //获取登录用户信息
    getUserInfo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getUserInfo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //获取设备信息
    saveSerialNumber: function (option) {
        var defaultOption = {
            version: "1",
            serialNumber: "",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=saveSerialNumber',
            '&version=', cfg.version,
            '&serialNumber=', encodeURIComponent(cfg.serialNumber),
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //获取设备信息
    getDeviceInfo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getDeviceInfo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //获取WiFi信息
    getWiFiInfo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getWiFiInfo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //设置是否锁定屏幕
    setIdleTimer: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            disable: "false"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=setIdleTimer',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&disable=', cfg.disable].join('');
        MobileJS.customSchema(uri);
    },


    //* 2018/3/15 yhy 新增扫描枪扫描docScan
    //扫描枪扫描
    docScan: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            operate: "connect"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=docScan',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&operate=', cfg.operate].join('');
        MobileJS.customSchema(uri);
    },

    //* 2021/7/15 yhy 新增RFID盘询接口getInventoryInfo
    getInventoryInfo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            type: "0",
            operate: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getInventoryInfo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&type=', cfg.type,
                    '&operate=', cfg.operate].join('');
        MobileJS.customSchema(uri);
    },

    //* 2021/8/18 yhy 新增网络故障检测接口networkCheck
    networkCheck: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=networkCheck',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //* 2021/8/18 yhy 新增获取网络故障检测报告接口getNetworkCheckReport
    getNetworkCheckReport: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getNetworkCheckReport',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //  2020/3/25 yhy 新增生成条形码/二维码信息makeCode
    //生成条形码/二维码信息
    makeCode: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            content: "",
            mode: "qrCode",
            imageType: "jpg",
            width: 400,
            height: 400,
            logo: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=makeCode',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&content=', encodeURIComponent(cfg.content),
                    '&mode=', cfg.mode,
                    '&imageType=', cfg.imageType,
                    '&width=', cfg.width,
                    '&height=', cfg.height,
                    '&logo=', encodeURIComponent(cfg.logo)].join('');
        MobileJS.customSchema(uri);
    },

    //读取条形码/二维码信息
    getCode: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "multCode"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getCode',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&mode=', cfg.mode].join('');
        MobileJS.customSchema(uri);
    },

    //  2020/4/27 yhy 扫描身份证新增参数needSave
    //扫描身份证
    scanIDCard: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            maxSize: 0,   //扫描后的图片最大大小限制，单位KB，默认为0不限制
            needSave: true,
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=scanIDCard',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&maxSize=', cfg.maxSize,
                    '&needSave=', cfg.needSave].join('');
        MobileJS.customSchema(uri);
    },

    //扫描银行卡
    scanBankCard: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            maxSize: 0   //扫描后的图片最大大小限制，单位KB，默认为0不限制
        }

        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=scanBankCard',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&maxSize=', cfg.maxSize].join('');
        MobileJS.customSchema(uri);
    },

    //扫描营业执照
    scanBusinessLicense: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }

        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=scanBusinessLicense',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    // 2018/5/18 yhy 新增名片识别bizCardRecognition
    //名片识别
    bizCardRecognition: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=bizCardRecognition',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //人脸识别
    faceRecognition: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            cameraType: "0",   //默认前置摄像头
            faceType: "0",   //识别模式，默认活体检测
            keyNum: 0   //关键数字
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=faceRecognition',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&cameraType=', cfg.cameraType,
                    '&faceType=', cfg.faceType,
                    '&keyNum=', cfg.keyNum].join('');
        MobileJS.customSchema(uri);
    },

    //人脸识别
    faceRecognitionV2: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "0",
            os: "",
            appid: "",
            secret: "",
            name: "",   //姓名，必传，非空
            idcard: "",   //身份证号码，必传，非空
            liveness: 0,   //0 - 静态照片检测 1 - 活体检测 2 - 混合检测，，，，必传，非空
            motions: "" //0 - 眨眼  1 - 张嘴
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=faceRecognitionV2',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&mode=', cfg.mode,
                    '&os=', cfg.os,
                    '&appid=', cfg.appid,
                    '&secret=', cfg.secret,
                    '&name=', cfg.name,
                    '&idcard=', cfg.idcard,
                    '&liveness=', cfg.liveness,
                    '&motions=', cfg.motions].join('');
        MobileJS.customSchema(uri);
    },

    //地址本选择器
    addressBook: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "user",
            rootOrgId: "100001",
            rootOrgName: "招商银行",
            selected: [],
            maxCount: "20"
        }
        var cfg = this.extend(defaultOption, option);
        var selectedStr = JSON.stringify(cfg.selected);
        var uri = ['ystMO:///?schema=addressBook',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&mode=', cfg.mode,
					'&rootOrgId=', cfg.rootOrgId,
					'&rootOrgName=', cfg.rootOrgName,
					'&selected=', encodeURIComponent(selectedStr),
					'&maxCount=', cfg.maxCount].join('');
        MobileJS.customSchema(uri);
    },

    //本机通讯录选择器
    contactBook: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            maxCount: "1"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=contactBook',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&maxCount=', cfg.maxCount].join('');
        MobileJS.customSchema(uri);
    },

    //2018/3/12 yhy 新增接口手机通讯录选择器phoneSelector
    //手机通讯录选择器
    phoneSelector: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=phoneSelector',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //2018/5/2 yhy 新增保存联系人到手机通讯录saveContact
    //手机通讯录选择器
    saveContact: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            name: "",
            company: "",
            position: "",
            email: "",
            tel: "",
            mobile: "",
            photo:""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=saveContact',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&name=', cfg.name,
					'&company=', cfg.company,
					'&position=', cfg.position,
					'&mobile=', cfg.mobile,
                    '&tel=', cfg.tel,
					'&email=', cfg.email,
					'&photo=', encodeURIComponent(cfg.photo)].join('');
        MobileJS.customSchema(uri);
    },

    //2021/4/13 yhy 打开url新增参数webTransparent
    //2018/7/24 yhy 打开url新增参数webWatermark
    //打开url文件
    openUrl: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            id: "",
            webType: "",
            title: "",
            url: "",
            webToolBar: "",
            webNavBar: "",
            webOrientation: "",
            webWatermark: "",
            webTransparent: "",
            useWKWebView: "",
            quitPage:"",
            query: {},
            hash: "",
            lightAppId: "",
            lightAppUrl: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=openUrl',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&id=', cfg.id,
					'&webType=', cfg.webType,
					'&title=', encodeURIComponent(cfg.title),
					'&url=', encodeURIComponent(cfg.url),
					'&webToolBar=', cfg.webToolBar,
                    '&useWKWebView=', cfg.useWKWebView,
                    '&webNavBar=', cfg.webNavBar,
					'&webOrientation=', cfg.webOrientation,
                    '&webWatermark=', cfg.webWatermark,
                    '&webTransparent=', cfg.webTransparent,
                    '&quitPage=', cfg.quitPage,
                    '&lightAppId=', encodeURIComponent(cfg.lightAppId),
                    '&lightAppUrl=', encodeURIComponent(cfg.lightAppUrl),
                    '&query=', encodeURIComponent(JSON.stringify(cfg.query)),
                    '&hash=', encodeURIComponent(cfg.hash)].join('');
        MobileJS.customSchema(uri);
    },

    //  2021/9/18 yhy 新增loadUrlWithHeaders
    //  附带Headers加载网页
    loadUrlWithHeaders: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            url: "",
            headers: {}
        }
        var cfg = this.extend(defaultOption, option);
        var dataStr = JSON.stringify(cfg.headers);
        var uri = ['ystMO:///?schema=loadUrlWithHeaders',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData),
            '&url=', encodeURIComponent(cfg.url),
            '&headers=', encodeURIComponent(dataStr)].join('');
        MobileJS.customSchema(uri);
    },

    //2021-03-05 yhy 打开系统设置页
    openSysSetting: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=openSysSetting',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);

    },

    //2020-08-24 pzh 打开WPS云文档选择器
    openWPSSelector:function(option){
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            selectorType: "0"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=openWPSSelector',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&selectorType=', cfg.selectorType].join('');
        MobileJS.customSchema(uri);
    },

    //唤醒地图导航
    mapDirection: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            slat: "",
            slon: "",
            sname: "",
            dlat: "",
            dlon: "",
            dname: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=mapDirection',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&slat=', cfg.slat,
                    '&slon=', cfg.slon,
                    '&sname=', encodeURIComponent(cfg.sname),
                    '&dlat=', cfg.dlat,
                    '&dlon=', cfg.dlon,
                    '&dname=', encodeURIComponent(cfg.dname)].join('');
        window.location = uri;
    },

    //新建日程
    newSchedule: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            ref: "",
            subject: "",
            place: "",
            body: "",
            start: "",
            end: "",
            refId: "",  // 来源系统关联ID
            pcParm: "",  // 来源系统PC端关联URL的参数
            moParm: "",  // 来源系统移动端关联URL的参数
        }
        var cfg = this.extend(defaultOption, option);
        if (cfg.subject.length > 50)
            cfg.subject = cfg.subject.substring(0, 50);
        if (cfg.place.length > 50)
            cfg.place = cfg.place.substring(0, 50);
        if (cfg.body.length > 50)
            cfg.body = cfg.body.substring(0, 50);
        var hash = ['ref=', cfg.ref,
                    '&subject=', encodeURIComponent(cfg.subject),
                    '&place=', encodeURIComponent(cfg.place),
                    '&body=', encodeURIComponent(cfg.body),
                    '&start=', cfg.start,
                    '&end=', cfg.end,
                    '&refId=', encodeURIComponent(cfg.refId),
                    '&pcParm=', encodeURIComponent(cfg.pcParm),
                    '&moParm=', encodeURIComponent(cfg.moParm)].join('');
        MobileJS.openUrl({
            version: cfg.version,
            callback: cfg.callback,
            asyncData: encodeURIComponent(cfg.asyncData),
            id: "0002",
            hash: hash
        });
    },

    //新建邮件
    newEmail: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            toNames: "",
            toAddrs: "",
            ccNames: "",
            ccAddrs: "",
            bccNames: "",
            bccAddrs: "",
            subject: "",
            content: ""
        }
        var cfg = this.extend(defaultOption, option);
        var mailOption = {
            toNames: cfg.toNames,
            toAddrs: cfg.toAddrs,
            ccNames: cfg.ccNames,
            ccAddrs: cfg.ccAddrs,
            bccNames: cfg.bccNames,
            bccAddrs: cfg.bccAddrs,
            subject: cfg.subject,
            content: cfg.content
        }
        var hash = 'jstr=' + encodeURIComponent(JSON.stringify(mailOption));
        MobileJS.openUrl({
            version: cfg.version,
            callback: cfg.callback,
            asyncData: encodeURIComponent(cfg.asyncData),
            id: "0003",
            hash: hash
        });
    },

    //新增意见反馈
    newFeedback: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=newFeedback',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    //退出系统
    quitSys: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            returnData:""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=quitSys',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&returnData=', encodeURIComponent(cfg.returnData)].join('');
        MobileJS.customSchema(uri);
    },

    //二次校验手势密码
    checkGesturePwd: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            timeOut: 0
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=checkGesturePwd',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&timeOut=', cfg.timeOut].join('');
        MobileJS.customSchema(uri);
    },
    //锁定屏幕
    lockScreen: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=lockScreen',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    //获取状态栏高度
    getStatusBarHeight: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getStatusBarHeight',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    //改变导航栏颜色
    statusBar: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            color: "#ffffff"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=statusBar',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData),
            '&color=', encodeURIComponent(cfg.color)].join('');
        MobileJS.customSchema(uri);
    },
    //操作导航栏
    navigationBar: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            hidden: "Y",
            animate: "Y"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=navigationBar',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&hidden=', cfg.hidden,
					'&animate=', cfg.animate].join('');
        MobileJS.customSchema(uri);
    },
    //操作网页水印
    webWaterMark: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            hidden: "Y"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=webWaterMark',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&hidden=', cfg.hidden].join('');
        MobileJS.customSchema(uri);
    },
    //复制文本到剪贴板
    copyText: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            text: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=copyText',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&text=', encodeURIComponent(cfg.text)].join('');
        MobileJS.customSchema(uri);
    },
    //2018/3/20 yhy 新增控制打印机打印printer
    //复制文本到剪贴板
    printer: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            ipAddress: "",
            ipPort: "",
            text: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=printer',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&ipAddress=', cfg.ipAddress,
                    '&ipPort=', cfg.ipPort,
					'&text=', encodeURIComponent(cfg.text)].join('');
        MobileJS.customSchema(uri);
    },

    //2018/7/3 yhy 新增关闭网页页面closePage
    //关闭网页
    closePage: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=closePage',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    //2018/7/18 yhy 新增蓝牙通信bluetoothCommunication
    //蓝牙通信
    bluetoothCommunication: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            prefixFilter: "",
            dataFilter: "",
            operation: "",
            serviceUUID: "",
            receiveUUID: "",
            sendUUID: "",
            command: "",
            needUI:"true",
            name: "",
            timeout:"10000"
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=bluetoothCommunication',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&prefixFilter=', encodeURIComponent(cfg.prefixFilter),
                    '&dataFilter=', encodeURIComponent(cfg.dataFilter),
                    '&operation=', encodeURIComponent(cfg.operation),
                    '&command=', encodeURIComponent(cfg.command),
                    '&serviceUUID=', encodeURIComponent(cfg.serviceUUID),
                    '&receiveUUID=', encodeURIComponent(cfg.receiveUUID),
                    '&sendUUID=', encodeURIComponent(cfg.sendUUID),
                    '&needUI=', encodeURIComponent(cfg.needUI),
                    '&name=', encodeURIComponent(cfg.name),
                    '&timeout=', encodeURIComponent(cfg.timeout)].join('');
        MobileJS.customSchema(uri);

    },
    //2021/4/29 zhuwei 新增密码键盘 safeKeyboard
    // 密码键盘
    safeKeyboard: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            key: "",
            action: "",
            mode: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=safeKeyboard',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&action=',cfg.action,
                    '&mode=',cfg.mode,
                    '&key=', encodeURIComponent(cfg.key),
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);

    },
    //2018/8/29 yhy 新增检测移动设备是否安装某app checkAppIsInstalled
    //检测移动设备是否安装某app
    checkAppIsInstalled: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            schemaName: "",
            packageName: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=checkAppIsInstalled',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&schemaName=', encodeURIComponent(cfg.schemaName),
                    '&packageName=', encodeURIComponent(cfg.packageName)].join('');
        MobileJS.customSchema(uri);
    },
    //唤起移事通检查最新版本，提示用户升级移事通
    appUpgrade: function(option){
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=appUpgrade',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    getWebPageType: function (option){
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getWebPageType',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },
    // 2019/6/26 yhy
    // 新增记录web前端日志 recordWebLog
    recordWebLog: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            logInfo: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=recordWebLog',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&logInfo=', encodeURIComponent(cfg.logInfo)].join('');
        MobileJS.customSchema(uri);
    },

    //查看用户详情
    showContactsUserInfo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            id: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=showContactsUserInfo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&id=', cfg.id].join('');
        MobileJS.customSchema(uri);
    },
    //录音
    audioRecord: function (option) {
        var defaulOption = {
            version: "1",
            callback: {},
            asyncData: "",
            returnAudio: "true",
            samplingRate: "8000",
            samplingBits: "8",
            outfileExt: "m4a",
            needTranslate: "true"
        }
        var cfg = this.extend(defaulOption, option);
        var uri = ['ystMO:///?schema=audioRecord',
                   '&version=', cfg.version,
                   '&callback=', cfg.callback,
                   '&asyncData=', encodeURIComponent(cfg.asyncData),
                   '&samplingRate=', encodeURIComponent(cfg.samplingRate),
                   '&samplingBits=', encodeURIComponent(cfg.samplingBits),
                   '&outfileExt=', encodeURIComponent(cfg.outfileExt),
                   '&returnAudio=', encodeURIComponent(cfg.returnAudio),
                   '&needTranslate=', encodeURIComponent(cfg.needTranslate)].join('');
        MobileJS.customSchema(uri);
    },
    //签名
    signPicture: function (option) {
        var defaulOption = {
            version: "1",
            callback: {},
            asyncData: "",
            originImageUrl: "",
            left: "",
            top: "",
            right: "",
            bottom: "",
            maxSize: 0,   //签名后图片压缩到的最大大小，单位KB（0表示不限制）
        }
        var cfg = this.extend(defaulOption, option);
        var uri = ['ystMO:///?schema=signPicture',
                   '&version=', cfg.version,
                   '&callback=', cfg.callback,
                   '&asyncData=', encodeURIComponent(cfg.asyncData),
                   '&left=', cfg.left,
                   '&top=', cfg.top,
                   '&right=', cfg.right,
                   '&bottom=', cfg.bottom,
                   '&originImageUrl=', encodeURIComponent(cfg.originImageUrl),
                   '&maxSize=', cfg.maxSize].join('');
        MobileJS.customSchema(uri);
    },
    //通过一事通id唤起招乎单人聊天
    singleChat: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            id: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=singleChat',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&id=', cfg.id].join('');
        MobileJS.customSchema(uri);
    },

    //通过群聊id唤起招乎群聊界面
    groupChat: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            groupId: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=groupChat',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&groupId=', cfg.groupId].join('');
        MobileJS.customSchema(uri);
    },

    //进入招乎回话列表界面
    openZHChatList: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=openZHChatList',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    // 2018/5/22 yhy 新增发起招乎呼叫callOut
    callOut: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            bucketName: "",
            openId: "",
            callType: "",
            needRecord: "false",
            outerId: "",
            recordType: "",
            layoutType: "",
            watermark1: "",
            watermark2: "",
            watermark3: "",
            watermark4: "",
            watermarkStyle: "",
            groupId: 0,
            ext: ""
        }
        var cfg = this.extend(defaultOption, option);
        if (cfg.watermark1.length > 128) {
            cfg.watermark1 = cfg.watermark1.substring(0, 128)
        }
        if (cfg.watermark2.length > 128) {
            cfg.watermark2 = cfg.watermark2.substring(0, 128)
        }
        if (cfg.watermark3.length > 128) {
            cfg.watermark3 = cfg.watermark3.substring(0, 128)
        }
        if (cfg.watermark4.length > 128) {
            cfg.watermark4 = cfg.watermark4.substring(0, 128)
        }
        var uri = ['ystMO:///?schema=callOut',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&bucketName=', cfg.bucketName,
                    '&openId=', cfg.openId,
                    '&callType=', cfg.callType,
                    '&needRecord=', cfg.needRecord,
                    '&outerId=', cfg.outerId,
                    '&recordType=', cfg.recordType,
                    '&layoutType=', cfg.layoutType,
                    '&watermark1=', cfg.watermark1,
                    '&watermark2=', cfg.watermark2,
                    '&watermark3=', cfg.watermark3,
                    '&watermark4=', cfg.watermark4,
                    '&watermarkStyle=', cfg.watermarkStyle,
                    '&groupId=', cfg.groupId,
                    '&ext=', encodeURIComponent(cfg.ext)].join('');
        MobileJS.customSchema(uri);
    },

    // 2018/5/22 yhy 新增获取招乎录制文件getRecordFile
    getRecordFile: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            meetingId: "",
            outerId: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getRecordFile',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&meetingId=', cfg.meetingId,
                    '&outerId=', cfg.outerId].join('');
        MobileJS.customSchema(uri);
    },

    // 2020/4/15 yhy 新增获取招乎截屏文件getScreenshot
    getScreenshot: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getScreenshot',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    },

    // 2018/11/29 yhy 新增获取当前招乎呼叫状态fetchCallState
    fetchCallState: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
      //      meetingId: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=fetchCallState',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                 //   '&meetingId=', cfg.meetingId
                    ].join('');
        MobileJS.customSchema(uri);
    },

    // 2020/05/12 yhy 新增设置招乎事件监听setZHEventListener
    setZHEventListener: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            //      meetingId: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=setZHEventListener',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                 //   '&meetingId=', cfg.meetingId
        ].join('');
        MobileJS.customSchema(uri);
    },

    //通过一事通id和SapId唤起招乎群聊界面
    createGroup: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            groupName: "",
            groupMember: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=createGroup',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&groupName=', encodeURIComponent(cfg.groupName),
					'&groupMember=', cfg.groupMember].join('');
        MobileJS.customSchema(uri);
    },

    //通过一事通id和SapId唤起招乎群聊界面
    groupAddressToChat: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            userData: "",
            content: {},
        }
        var cfg = this.extend(defaultOption, option);
        var dataStr = JSON.stringify(cfg.userData);
        var uri = ['ystMO:///?schema=groupAddressToChat',
            '&version=', cfg.version,
            '&callback=', cfg.callback,
            '&asyncData=', encodeURIComponent(cfg.asyncData),
            '&userData=', encodeURIComponent(dataStr),
            '&content=', encodeURIComponent(JSON.stringify(cfg.content))].join('');
        MobileJS.customSchema(uri);
    },

    //调用招呼视频播放
    openZHVideo: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            liveId: "",
            mediaType: 0,
            token: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=openZHVideo',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&liveId=', cfg.liveId,
                    '&mediaType=', cfg.mediaType,
                    '&token=', cfg.token].join('');
        MobileJS.customSchema(uri);
    },
    //分享文件-20200306
    shareFile: function (option) {
        var defaultOption = {
            callback: {},
            asyncData: "",
            fileName: "",
            fileUrl: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=shareFile',
                        '&callback=', cfg.callback,
                        '&asyncData=', encodeURIComponent(cfg.asyncData),
                        '&fileName=', encodeURIComponent(cfg.fileName),
                        '&fileUrl=', encodeURIComponent(cfg.fileUrl)].join('');
        MobileJS.customSchema(uri);
    },
    //分享url链接到招乎
    shareUrlToZH: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            title: "",//标题（必填）
            subject: "",//摘要（可空）
            image: "",//base64缩略图数据，（可空，使用默认图片）
            url: "",//url或CMBMobileOA协议（必填）
            sessionId: ""   //  会话id （可选）
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=shareUrlToZH',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&title=', encodeURIComponent(cfg.title),
					'&subject=', encodeURIComponent(cfg.subject),
					'&image=', encodeURIComponent(cfg.image),
                    '&sessionId=', encodeURIComponent(cfg.sessionId),
					'&url=', encodeURIComponent(cfg.url)].join('');
        MobileJS.customSchema(uri);
    },
    //分享卡片到招乎

    shareInfoCardToZH: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            inputParam: "",//（必填）

        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=shareInfocardToZH',
					'&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
					'&inputParam=', encodeURIComponent(cfg.inputParam)].join('');
        MobileJS.customSchema(uri);
    },
    //分享到微信
    shareToWeChat: function (option) {
        var defaulOption = {
            version: "1",
            callback: {},
            asyncData: "",
            imageUrl: "",
            title: "",
            description: "",
            url: "",
            scene: "1"
        }
        var cfg = this.extend(defaulOption, option);
        var uri = ['ystMO:///?schema=shareToWeChat',
                   '&version=', cfg.version,
                   '&callback=', cfg.callback,
                   '&asyncData=', encodeURIComponent(cfg.asyncData),
                   '&imageUrl=', encodeURIComponent(cfg.imageUrl),
                   '&title=', encodeURIComponent(cfg.title),
                   '&description=', encodeURIComponent(cfg.description),
                   '&url=', encodeURIComponent(cfg.url),
                   '&scene=', encodeURIComponent(cfg.scene)].join('');
        MobileJS.customSchema(uri);
    },
    //分享到微信
    shareToWorkWeChat: function (option) {
        var defaulOption = {
            version: "1",
            callback: {},
            asyncData: "",
            type: "1",
            text: "",
            subText: "",
            image: "",
            url: ""
        }
        var cfg = this.extend(defaulOption, option);
        var uri = ['ystMO:///?schema=shareToWorkWeChat',
                   '&version=', cfg.version,
                   '&callback=', cfg.callback,
                   '&asyncData=', encodeURIComponent(cfg.asyncData),
                   '&type=', cfg.type,
                   '&text=', encodeURIComponent(cfg.text),
                   '&subText=', encodeURIComponent(cfg.subText),
                   '&image=', encodeURIComponent(cfg.image),
                   '&url=', encodeURIComponent(cfg.url)].join('');
        MobileJS.customSchema(uri);
    },
    //添加或移除工作台系统，配合checkHomeItemAdded使用
    addOrRemoveHomeItem: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            sysId: "",
            operation: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=addOrRemoveHomeItem',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&sysId=', cfg.sysId,
                    '&operation=', cfg.operation].join('');
        MobileJS.customSchema(uri);
    },
    //检查工作台是否存在某系统
    checkHomeItemAdded: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            sysId: ""
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=checkHomeItemAdded',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&sysId=', cfg.sysId].join('');
        MobileJS.customSchema(uri);
    },

    //2018/4/24 yhy 新增改变屏幕方向changeOrientation
    //改变屏幕方向
    changeOrientation: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            orientation: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=changeOrientation',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&orientation=', cfg.orientation].join('');
        MobileJS.customSchema(uri);
    },

    //2019/9/18 yhy 新增本地键值对存储keyValueStorage
    //改变屏幕方向
    keyValueStorage: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
            mode: "",
            tag: "",
            key: "",
            value: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=keyValueStorage',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData),
                    '&mode=', cfg.mode,
                    '&tag=', encodeURIComponent(cfg.tag),
                    '&key=', encodeURIComponent(cfg.key),
                    '&value=', encodeURIComponent(cfg.value), ].join('');
        MobileJS.customSchema(uri);
    },

    getWechatToken: function (option) {
        var defaultOption = {
            version: "1",
            callback: {},
            asyncData: "",
        }
        var cfg = this.extend(defaultOption, option);
        var uri = ['ystMO:///?schema=getWechatToken',
                    '&version=', cfg.version,
                    '&callback=', cfg.callback,
                    '&asyncData=', encodeURIComponent(cfg.asyncData)].join('');
        MobileJS.customSchema(uri);
    }
}
export default MobileJS